package com.yjt.fresh.bean;

import android.support.annotation.NonNull;

import com.yjt.fresh.service.Utils;

/**
 * 商品
 * Created by mcc on 2018/7/11.
 */

public class BeanProduct implements Comparable<BeanProduct>{
    /**
     * CREATE_TIME : 2018-07-11 18:07:08
     * STORE_ENTER_FEE : 0
     * SOURCE_SID : 12123
     * TWO_IMG :
     * DISPLAY_PRICE : 1
     * STATUS : 1
     * SIX_IMG :
     * LIMIT_BUY : 1
     * STORE_TEL : 14795592971
     * SORT : 1
     * STORE_LOGO_IMG : http://pic.kanglvquan.com/98a8a4b711e84a7fa3d852d9ff53f478.jpg
     * CONTENT : <p>1</p>
     * ONE_TYPE : 社区果蔬
     * STORE_CITY : 南宁
     * GOODS_ID : 506f5e323aed42f699a68cd4ce33d044
     * THREE_IMG :
     * TWO_TYPE : 玉米
     * STORE_BOND : 0
     * STORE_PROVINCE : 广西
     * SHAREGOODSDETAIL : /app/goods/shareGoodsDetail?GOODS_ID=506f5e323aed42f699a68cd4ce33d044
     * COVER_IMG : http://pic.wepo8.com/69e44f16ee69480788726b55864600d3.jpg
     * ONE_IMG : http://pic.wepo8.com/4c72a75ad7974f6bb956acfbcc957881.jpg
     * STORE_LATITUDE_LONGITUDE : 108.265868,22.795653
     * FOUR_IMG :
     * DISPLAY_SINGLE_PRICE : 1
     * UPDATE_TIME : 2018-07-11 18:07:08
     * STORE_ID : de8645357d7444179e2c960fc2e68353
     * SHARE_IMG : http://pic.wepo8.com/bd65edcf75774c5cb23532d627e60524.jpg
     * IS_INDEX : 1
     * STORE_ADDRESS : 广西壮族自治区南宁市江南区南宁国际商业贸易中心A11栋2601
     * BREVIARY_IMG : http://pic.wepo8.com/ac9110e82fe748b29ed0b7ee2ab76579.jpg
     * FREIGHT_MONEY : 1
     * STORE_NAME : 广西雅之佳商贸有限公司
     * FIVE_IMG :
     * GOODSCONTENT : /app/goods/goodsContent?GOODS_ID=506f5e323aed42f699a68cd4ce33d044
     * STORE_ONE_TYPE : 全部
     * TITLE : 2qe
     */

    private double localLatitude;
    private double localLongitude;
    private String CREATE_TIME;
    private String STORE_ENTER_FEE;
    private String SOURCE_SID;
    private String TWO_IMG;
    private String DISPLAY_PRICE;
    private String STATUS;
    private String SIX_IMG;
    private String LIMIT_BUY;
    private String STORE_TEL;
    private String SORT;
    private String STORE_LOGO_IMG;
    private String CONTENT;
    private String ONE_TYPE;
    private String STORE_CITY;
    private String GOODS_ID;
    private String THREE_IMG;
    private String TWO_TYPE;
    private String STORE_BOND;
    private String STORE_PROVINCE;
    private String SHAREGOODSDETAIL;
    private String COVER_IMG;
    private String ONE_IMG;
    private String STORE_LATITUDE_LONGITUDE;
    private String FOUR_IMG;
    private String DISPLAY_SINGLE_PRICE;
    private String UPDATE_TIME;
    private String STORE_ID;
    private String SHARE_IMG;
    private String IS_INDEX;
    private String STORE_ADDRESS;
    private String BREVIARY_IMG;
    private String FREIGHT_MONEY;
    private String STORE_NAME;
    private String FIVE_IMG;
    private String GOODSCONTENT;
    private String STORE_ONE_TYPE;
    private String TITLE;
    private String GROUP_COUNT;

    public String getGROUP_COUNT() {
        return GROUP_COUNT;
    }

    public void setGROUP_COUNT(String GROUP_COUNT) {
        this.GROUP_COUNT = GROUP_COUNT;
    }

    public String getCREATE_TIME() {
        return CREATE_TIME;
    }

    public void setCREATE_TIME(String CREATE_TIME) {
        this.CREATE_TIME = CREATE_TIME;
    }

    public String getSTORE_ENTER_FEE() {
        return STORE_ENTER_FEE;
    }

    public void setSTORE_ENTER_FEE(String STORE_ENTER_FEE) {
        this.STORE_ENTER_FEE = STORE_ENTER_FEE;
    }

    public String getSOURCE_SID() {
        return SOURCE_SID;
    }

    public void setSOURCE_SID(String SOURCE_SID) {
        this.SOURCE_SID = SOURCE_SID;
    }

    public String getTWO_IMG() {
        return TWO_IMG;
    }

    public void setTWO_IMG(String TWO_IMG) {
        this.TWO_IMG = TWO_IMG;
    }

    public String getDISPLAY_PRICE() {
        return DISPLAY_PRICE;
    }

    public void setDISPLAY_PRICE(String DISPLAY_PRICE) {
        this.DISPLAY_PRICE = DISPLAY_PRICE;
    }

    public String getSTATUS() {
        return STATUS;
    }

    public void setSTATUS(String STATUS) {
        this.STATUS = STATUS;
    }

    public String getSIX_IMG() {
        return SIX_IMG;
    }

    public void setSIX_IMG(String SIX_IMG) {
        this.SIX_IMG = SIX_IMG;
    }

    public String getLIMIT_BUY() {
        return LIMIT_BUY;
    }

    public void setLIMIT_BUY(String LIMIT_BUY) {
        this.LIMIT_BUY = LIMIT_BUY;
    }

    public String getSTORE_TEL() {
        return STORE_TEL;
    }

    public void setSTORE_TEL(String STORE_TEL) {
        this.STORE_TEL = STORE_TEL;
    }

    public String getSORT() {
        return SORT;
    }

    public void setSORT(String SORT) {
        this.SORT = SORT;
    }

    public String getSTORE_LOGO_IMG() {
        return STORE_LOGO_IMG;
    }

    public void setSTORE_LOGO_IMG(String STORE_LOGO_IMG) {
        this.STORE_LOGO_IMG = STORE_LOGO_IMG;
    }

    public String getCONTENT() {
        return CONTENT;
    }

    public void setCONTENT(String CONTENT) {
        this.CONTENT = CONTENT;
    }

    public String getONE_TYPE() {
        return ONE_TYPE;
    }

    public void setONE_TYPE(String ONE_TYPE) {
        this.ONE_TYPE = ONE_TYPE;
    }

    public String getSTORE_CITY() {
        return STORE_CITY;
    }

    public void setSTORE_CITY(String STORE_CITY) {
        this.STORE_CITY = STORE_CITY;
    }

    public String getGOODS_ID() {
        return GOODS_ID;
    }

    public void setGOODS_ID(String GOODS_ID) {
        this.GOODS_ID = GOODS_ID;
    }

    public String getTHREE_IMG() {
        return THREE_IMG;
    }

    public void setTHREE_IMG(String THREE_IMG) {
        this.THREE_IMG = THREE_IMG;
    }

    public String getTWO_TYPE() {
        return TWO_TYPE;
    }

    public void setTWO_TYPE(String TWO_TYPE) {
        this.TWO_TYPE = TWO_TYPE;
    }

    public String getSTORE_BOND() {
        return STORE_BOND;
    }

    public void setSTORE_BOND(String STORE_BOND) {
        this.STORE_BOND = STORE_BOND;
    }

    public String getSTORE_PROVINCE() {
        return STORE_PROVINCE;
    }

    public void setSTORE_PROVINCE(String STORE_PROVINCE) {
        this.STORE_PROVINCE = STORE_PROVINCE;
    }

    public String getSHAREGOODSDETAIL() {
        return SHAREGOODSDETAIL;
    }

    public void setSHAREGOODSDETAIL(String SHAREGOODSDETAIL) {
        this.SHAREGOODSDETAIL = SHAREGOODSDETAIL;
    }

    public String getCOVER_IMG() {
        return COVER_IMG;
    }

    public void setCOVER_IMG(String COVER_IMG) {
        this.COVER_IMG = COVER_IMG;
    }

    public String getONE_IMG() {
        return ONE_IMG;
    }

    public void setONE_IMG(String ONE_IMG) {
        this.ONE_IMG = ONE_IMG;
    }

    public String getSTORE_LATITUDE_LONGITUDE() {
        return STORE_LATITUDE_LONGITUDE;
    }

    public void setSTORE_LATITUDE_LONGITUDE(String STORE_LATITUDE_LONGITUDE) {
        this.STORE_LATITUDE_LONGITUDE = STORE_LATITUDE_LONGITUDE;
    }

    public String getFOUR_IMG() {
        return FOUR_IMG;
    }

    public void setFOUR_IMG(String FOUR_IMG) {
        this.FOUR_IMG = FOUR_IMG;
    }

    public String getDISPLAY_SINGLE_PRICE() {
        return DISPLAY_SINGLE_PRICE;
    }

    public void setDISPLAY_SINGLE_PRICE(String DISPLAY_SINGLE_PRICE) {
        this.DISPLAY_SINGLE_PRICE = DISPLAY_SINGLE_PRICE;
    }

    public String getUPDATE_TIME() {
        return UPDATE_TIME;
    }

    public void setUPDATE_TIME(String UPDATE_TIME) {
        this.UPDATE_TIME = UPDATE_TIME;
    }

    public String getSTORE_ID() {
        return STORE_ID;
    }

    public void setSTORE_ID(String STORE_ID) {
        this.STORE_ID = STORE_ID;
    }

    public String getSHARE_IMG() {
        return SHARE_IMG;
    }

    public void setSHARE_IMG(String SHARE_IMG) {
        this.SHARE_IMG = SHARE_IMG;
    }

    public String getIS_INDEX() {
        return IS_INDEX;
    }

    public void setIS_INDEX(String IS_INDEX) {
        this.IS_INDEX = IS_INDEX;
    }

    public String getSTORE_ADDRESS() {
        return STORE_ADDRESS;
    }

    public void setSTORE_ADDRESS(String STORE_ADDRESS) {
        this.STORE_ADDRESS = STORE_ADDRESS;
    }

    public String getBREVIARY_IMG() {
        return BREVIARY_IMG;
    }

    public void setBREVIARY_IMG(String BREVIARY_IMG) {
        this.BREVIARY_IMG = BREVIARY_IMG;
    }

    public String getFREIGHT_MONEY() {
        return FREIGHT_MONEY;
    }

    public void setFREIGHT_MONEY(String FREIGHT_MONEY) {
        this.FREIGHT_MONEY = FREIGHT_MONEY;
    }

    public String getSTORE_NAME() {
        return STORE_NAME;
    }

    public void setSTORE_NAME(String STORE_NAME) {
        this.STORE_NAME = STORE_NAME;
    }

    public String getFIVE_IMG() {
        return FIVE_IMG;
    }

    public void setFIVE_IMG(String FIVE_IMG) {
        this.FIVE_IMG = FIVE_IMG;
    }

    public String getGOODSCONTENT() {
        return GOODSCONTENT;
    }

    public void setGOODSCONTENT(String GOODSCONTENT) {
        this.GOODSCONTENT = GOODSCONTENT;
    }

    public String getSTORE_ONE_TYPE() {
        return STORE_ONE_TYPE;
    }

    public void setSTORE_ONE_TYPE(String STORE_ONE_TYPE) {
        this.STORE_ONE_TYPE = STORE_ONE_TYPE;
    }

    public String getTITLE() {
        return TITLE;
    }

    public void setTITLE(String TITLE) {
        this.TITLE = TITLE;
    }

    public double getLocalLatitude() {
        return localLatitude;
    }

    public void setLocalLatitude(double localLatitude) {
        this.localLatitude = localLatitude;
    }

    public double getLocalLongitude() {
        return localLongitude;
    }

    public void setLocalLongitude(double localLongitude) {
        this.localLongitude = localLongitude;
    }

    @Override
    public int compareTo(@NonNull BeanProduct beanProduct) {
        String[] locations = STORE_LATITUDE_LONGITUDE.split(",");
        String[] otherLocations = beanProduct.getSTORE_LATITUDE_LONGITUDE().split(",");
        double distance = Utils.getDistance(Double.valueOf(locations[1]), Double.valueOf(locations[0]), localLongitude, localLatitude);
        double otherDistance = Utils.getDistance(Double.valueOf(otherLocations[1]), Double.valueOf(otherLocations[0]), beanProduct.getLocalLongitude(), beanProduct.getLocalLatitude());
        if (distance > otherDistance){
            return 1;
        }else if (distance < otherDistance){
            return -1;
        }else {
            return 0;
        }
    }
}
